<%@ page import="auctionatr.Auction"%>
<html>
<head>
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'auction.label', default: 'Auction')}" />
<title><g:message code="user.gebotsliste.label" />
</title>
</head>
<body>

	<div class="body">
		<h1>
			<g:message code="user.gebotsliste.label" />
		</h1>

		<g:if test="${flash.message}">
			<div class="message">
				${flash.message}
			</div>
		</g:if>

		<p style="padding-left: 10px;">
			<g:message code="user.gebotsliste.explanation.label" />
		</p>

		<div class="list">
			<table>
				<thead>
					<tr>


						<th>
							${message(code: 'auction.name.label', default: 'Name')}
						</th>

						<th>
							${message(code: 'auction.description.label', default: 'Description')}
						</th>

						<th>
							${message(code: 'auction.finishDate.label', default: 'Finish Date')}
						</th>


						<th>
							${message(code: 'auction.myBid.label', default: 'Bid')}
						</th>
						
						<th>
							${message(code: 'auction.highestBid.label', default: 'Bid')}
						</th>

						<th>
							${message(code: 'auction.isFinished.label', default: 'is finished?')}
						</th>

					</tr>
				</thead>
				<tbody>


					<g:each in="${auctionInstanceList}" status="i"
						var="auctionInstance">
						<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">


							<td><g:link controller="auction" action="show"
									id="${auctionInstance[0]}">
									${auctionInstance[1]}
								</g:link></td>

							<td>
								${auctionInstance[2]}
							</td>

							<td><g:formatDate format="${message(code: 'default.date.format', default: 'DateFormat')}" date="${auctionInstance[3]}" /></td>
							<td><g:formatNumber number="${auctionInstance[4]}"
									type="currency" currencyCode="EUR" />
							</td>
							
							<td><g:formatNumber number="${auctionInstance[5]}"
									type="currency" currencyCode="EUR" /></td>
							
							
							<td><g:if test="${auctionInstance[3] < new Date()}">${message(code: 'default.yes', default: 'Y')}</g:if><g:else>-</g:else></td>
						</tr>
					</g:each>
				</tbody>
			</table>
		</div>
		<div class="paginateButtons">
			<g:paginate total="${auctionInstanceTotal}" />
		</div>
</body>
</html>
